package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/**
 * 文件的复制(快读写)
 * */
public class copyDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("./壁纸.png");
        FileOutputStream fos = new FileOutputStream("./壁纸1.png");
        long stsar = System.currentTimeMillis();
        byte[] data = new byte[1024*10];
        int len ;
        while ((len=fis.read(data))!=-1){
            //fos.write(data);
            fos.write(data,0,len);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕,一共耗时:"+(stsar-end)+"ms");

        fis.close();
        fos.close();

    }
}
